/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author mattia
 */
public class Utility {
    String os=System.getProperty("os.name");
    
    public void clear(){
        try{
            System.out.println("CLEAR");
            System.out.println("windows 8.1" + " == " + os.toLowerCase());
            if(os.toLowerCase().compareTo("windows") == 0 || 
                    os.toLowerCase().compareTo("windows xp") == 0 || 
                    os.toLowerCase().compareTo("windows vista") == 0 ||
                    os.toLowerCase().compareTo("windows 7") == 0 || 
                    os.toLowerCase().compareTo("windows 8") == 0 || 
                    os.toLowerCase().compareTo("windows 8.1") == 0){
                
                Runtime.getRuntime().exec("cls");
            }else{//Linux/Unix and Mac OS X
                System.out.println("Unix");
                Runtime.getRuntime().exec("clear");
            }
        }catch(Exception e){}
    }
}
